#include <stdlib.h>
#include <sys/socket.h>
#include "util.h"
#include <unistd.h>
#include <string.h>
#include "debug.h"
#include <signal.h>
#include "socket_helper.h"
#include "proxy.h"

void ignore_child_process(void){
	signal(SIGCHLD,SIG_IGN);
}

int main(int argc, char** argv) {

	int local_port;
	int local_sock;

	ignore_child_process();
	local_port = 9999;
	
	local_sock = create_server_socket(local_port);
	if (local_sock < 0) {
		LOG("port %d is inavailable \n",local_port);
		LOG("err : %d \n",local_sock);
		exit(1);
	}

	run_proxy(local_sock);
	return 0;


	


}